x <- 1000:1
y <- rep (1000, times=1000)
z <- x/y
zz <- cumprod(z)
min (which (zz <0.5))
